From: kfraser@localhost.localdomain Date: Tue, 14 Aug 2007 15:01:08 +0000 (+0100) Subject: [xen, xencomm] xencomm trivial bug fix X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15007^2~3 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/?a=commitdiff_plain;h=ad2c8b83e801340d21cca006d66879e90fc7ced6;p=xen.git [xen, xencomm] xencomm trivial bug fix - fix return address of xencomm_copy_to_guest() - fix xencomm_add_offset() Signed-off-by: Isaku Yamahata --- diff --git a/xen/common/xencomm.c b/xen/common/xencomm.c index 8b7e502869..3ee5d00c25 100644 --- a/xen/common/xencomm.c +++ b/xen/common/xencomm.c @@ -232,7 +232,7 @@ xencomm_copy_to_guest(void *to, const void *from, unsigned int n, dest_maddr = paddr_to_maddr(dest_paddr + chunk_skip); if (dest_maddr == 0) - return -1; + return n - from_pos; if (xencomm_debug) printk("%lx[%d] -> %lx\n", source, bytes, dest_maddr); @@ -280,6 +280,11 @@ int xencomm_add_offset(void **handle, unsigned int bytes) unsigned int chunksz; unsigned int chunk_skip; + if (dest_paddr == XENCOMM_INVALID) { + i++; + continue; + } + pgoffset = dest_paddr % PAGE_SIZE; chunksz = PAGE_SIZE - pgoffset; @@ -291,6 +296,8 @@ int xencomm_add_offset(void **handle, unsigned int bytes) desc->address[i] += chunk_skip; } bytes -= chunk_skip; + + i++; } return 0; }